<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="util" uri="/WEB-INF/kdd-util.tld" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<sec:authorize access="isAuthenticated()">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        <body>
            <jsp:include page="menu.jsp" />
            <script type="text/javascript">
                $(function() { 
                    var t = $('table#listtable')
                    $("#filter").keyup(function() {
                        $.uiTableFilter( t, this.value );
                    })
                });  
            </script>
            <div class="well row-fluid notfull">
                <h4><spring:message code="msg.results" /></h4><br />
                <div>
                    <input type="text" id="filter" placeholder="Filter" />
                    <table id="listtable" class="table table-striped table-bordered table-condensed">
                        <thead>
                            <tr>
                                <th class="creationdate"><spring:message code="msg.creationdate" /></th>
                                <th><spring:message code="msg.method" /></th>
                                <th><spring:message code="msg.creator" /></th>
                                <th class="details"><spring:message code="msg.details" /></th>
                            </tr>
                        </thead>
                        <tbody>
                            <c:forEach items="${lastResults}" var="r">
                                <tr>
                                    <td><fmt:formatDate value="${r.creationDate}" pattern="MM/dd/yyyy HH:mm"/></td>
                                    <td>${r.method.showName}</td>
                                    <td>${r.creator.username}</td>
                                    <td><a href="<c:url value='/result/${r.id}'/>"><spring:message code="msg.details" /></a></td>
                                </tr>
                            </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <jsp:include page="foot.jsp" />
        </sec:authorize>